"""
练习二：定义函数找出列表中的所有数字
 [43,"悟空",True,56,"八戒",87.5,98
"""
list1 =  [43,"悟空",True,56,"八戒",87.5,98]

# 定义生成器函数
def get_num(list1):
    for item in list1:
        if isinstance(item,(int,float)) and not isinstance(item,bool):
            yield item

# 调用生成器函数
for num in get_num(list1):
    print(num)